﻿using System.Collections;
using System.Collections.Generic;

using Dict.DataModel;
namespace Dict.Blo
{
    
    public class DictPetintimacyBlo
    {

        /// <summary>
        /// 获取宠物亲密度信息
        /// </summary>
        /// <param name="quality"></param>
        /// <param name="intimacyLevel"></param>
        /// <returns></returns>
        public static TablePetIntimacy GetPetBreachTalent(int quality, int intimacyLevel)
        {
            List<TablePetIntimacy> list = Dict.DictDataManager.Instance.tablePetIntimacyDao.GetByOneIndex(quality);
            return list[intimacyLevel - 1];

        }

        /// <summary>
        /// 宠物亲密度最大等级
        /// </summary>
        /// <param name="quality"></param>
        /// <param name="intimacyLevel"></param>
        /// <returns></returns>
        public static int GetPetBreachMaxLevel(int quality, int intimacyLevel)
        {
            int maxIntimacyLevel = 0;
            List<TablePetIntimacy> list = Dict.DictDataManager.Instance.tablePetIntimacyDao.GetByOneIndex(quality);
            if (list == null)
            {
                return 0;
            }

            foreach (var data in list)
            {
               if(intimacyLevel > data.intimacyLevel)
               {
                    maxIntimacyLevel = data.intimacyLevel;
               }    
            }
            return maxIntimacyLevel;
        }
        public static int GetAddtionTalentByIntimacyLevelAndQuality(int level, int quality)
        {
            return Dict.DictDataManager.Instance.tablePetIntimacyDao.GetByOneIndex(quality)[level].additionalTalent;
        }
    }
}
